package manager
{
	import data.Globals;
	
	import flash.display.Bitmap;
	import flash.events.Event;
	
	import utils.LoaderManage;

	/**
	 *
	 *@author CrazyChen 
	 *2013-3-31
	 */	
	public class AssetManage
	{
		[Embed(source="resources/pic/wall.png")]
		public static var wall:Class;
		
		[Embed(source="resources/pic/A.png")]
		public static var a_monster:Class;
		
		[Embed(source="resources/pic/B.png")]
		public static var b_monster:Class;
		
		[Embed(source="resources/pic/C.png")]
		public static var c_monster:Class;
		
		[Embed(source="resources/pic/弹药库.png")]
		public static var bulletHole:Class;
		
		public static var plantMap:Object;
		
		private static var num:int = 0;
		
		public static function loaderPlant():void{
			plantMap={};
			for(var i:int=1;i<=24;i++){	
				LoaderManage.getInstance().loaderContent(Globals.RES_URL+"map/plant"+i+".png",loadComplete,true);
			}
		}
		
		private static function loadComplete(event:Event,url:String):void
		{
			var ary:Array = url.split("/");
			plantMap[ary[ary.length-1].split(".")[0]] = event.target.content;
			num++;
			trace(num);
			if(num == 24){
				trace("plant material conplete");
				Globals.gameView.initPlant();
			}
		}
	}
}